﻿// =================================================================== 
// 项目说明
//====================================================================
// 
// 文件： SYS_MAILOWNER.cs
// 项目名称：


// 创建时间：2013/3/19
// 负责人：
// ===================================================================
using System;
using System.Data;
using CommonLib.Model;
using CommonLib.IDAL;
using CommonLib.DALFactory;

namespace CommonLib.BLL
{
    /// <summary>
    ///   的BLL层



    /// </summary>
    public class SYS_MAILOWNER : SYS_MAILOWNERBLLBase
    {
        #region ----------变量定义----------
        #endregion

        #region ----------构造函数----------
        /// <summary>
        /// 默认构造函数





        /// </summary>
        public SYS_MAILOWNER()
        {
        }
        #endregion

        #region----------函数定义---------
        public static void DelTrans(int MailID, string UserID, int FolderFlag)
        {
            CommonLib.BLL.MyTransaction myTrans = new CommonLib.BLL.MyTransaction();
            try
            {
                myTrans.BeginTransaction();
                int row = SYS_MAILOWNER.Delete(MailID, UserID, FolderFlag);
                if (row > 0)
                {
                    DataTable dtt = SYS_MAILOWNER.GetList("MailID=" + MailID + "").Tables[0];
                    if (dtt.Rows.Count == 0)
                        CommonLib.BLL.SYS_MAILINFO.Delete(MailID);
                }
                myTrans.CommitTran();
            }
            catch (Exception ex)
            {
                string strEx = ex.Message;
                myTrans.RollBackTran();
            }
        }
        #endregion
    }
}
